<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<!-- for-mobile-apps -->
<meta name="viewport" id="WebViewport" content="width=750, initial-scale=1 user-scalable = 0" />

<script language="javascript">  
    if(screen.width<750)
    {  
        document.getElementById('WebViewport').setAttribute('content', 'width=750px,initial-scale=' + screen.width / 750 + ',target-densitydpi=device-dpi,user-scalable=0');  
    }  
</script>  


<style>
  


</style>
</head>
	
<body>
	<div class="content">
	  <div class="title">
	  	 <p>为了提高预测准确性</p>
	  	 <p>请填写好经期数据哦</p>
	  </div>
	  <div class="select">
	  	 <div>
	  	 	<div>
	  	 		<p>月经周期</p><p>两次月经第一天的间隔世间</p>
	  	 	</div>
	  	 	<div>
	  	 		周期<span id="picker1">28</span>天
	  	 	</div>		
	  	 </div>
	  	 <div>
	  	 	<div>
	  	 		<p>天数</p><p>每次月经持续天数</p>
	  	 	</div>
	  	 	<div>
	  	 		经期<span id="picker2">5</span>天
	  	 	</div>		
	  	 </div>
	  </div>
      <div class="submit-btn">
	     
	     <form id="form" onsubmit="return false" action="##" method="post">
				  
			  <button type="button" value="保存" onclick="login()">保存</button>
		 </form>
      </div>
	</div>


<script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="js/picker.min.js"></script>
<script src="js/data.js"></script>
<script>


function login() {
            $.ajax({
            //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "index.html" ,//url
                data: $('#form').serialize(),
                success: function (result) {
                    console.log(result);//打印服务端返回的数据(调试用)
                    if (result.resultCode == 200) {
                        alert("SUCCESS");
                    }
                    ;
                },
                error : function() {
                	console.log($('#form').serialize());
                    alert("异常！");
                }
            });
        }






</script>




</body>
</html>